/** 主入口js */
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import setting from './config/setting';
import permission from '@/utils/permission';
import './config/axios-config';
import EleAdmin from 'ele-admin';
import './styles/index.scss';
import VueClipboard from 'vue-clipboard2';

Vue.prototype.$EventBus = new Vue();
Vue.prototype.websock = null;
Vue.prototype.websockHeartbeatIntervalID = 0;
Vue.prototype.reConnectIntervalID = 0;

Vue.prototype.setStore = function(key,val){
  localStorage.setItem(key,JSON.stringify(val));
};
Vue.prototype.getStore = function(key){
  return localStorage.getItem(key);
};

Vue.prototype.isElectron = false;
Vue.config.productionTip = false;
Vue.prototype.$setting = setting;
Vue.use(EleAdmin);
Vue.use(permission);
Vue.use(VueClipboard);
if (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1){
  Vue.prototype.isElectron = true;
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
